package com.jfinal.core;

import javax.servlet.http.HttpServletRequest;

import com.jfinal.kit.JsonKit;
import com.jfinal.render.JsonRender;
import com.jfinal.render.Render;
import com.jfinal.render.RenderFactory;

public class BaseController extends Controller {
	private static final RenderFactory renderFactory = RenderFactory.me();
	private String jsonText;

	

	/**
	 * Get model from http request.
	 */
	public <T> T getModel(Class<T> modelClass) {
		HttpServletRequest request = getRequest();
		return (T) BaseModelInjector.inject(modelClass, request, false);
	}

	/**
	 * Get model from http request.
	 */
	public <T> T getModel(Class<T> modelClass, String modelName) {
		HttpServletRequest request = getRequest();
		return (T) BaseModelInjector.inject(modelClass, modelName, request,
				false);
	}
}
